<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">维修师</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="maintenanceManForm" method="post">
                        <input type="hidden" id="id" name="id"/>
                        <!--姓名(name)-->
                        <div class="am-form-group">
                            <label for="name" class="am-u-sm-2 am-form-label">姓名
                                <span class="tpl-form-line-small-title">name</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="name" class="tpl-form-input" placeholder="请输入"
                                       name="name"/>
                            </div>
                        </div>

                        <!--性别(sex)-->
                        <div class="am-form-group">
                            <label for="sex" class="am-u-sm-2 am-form-label">性别
                                <span class="tpl-form-line-small-title">sex</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="sex" class="tpl-form-input" placeholder="请输入"
                                       name="sex"/>
                            </div>
                        </div>

                        <!--民族(nationality)-->
                        <div class="am-form-group">
                            <label for="nationality" class="am-u-sm-2 am-form-label">民族
                                <span class="tpl-form-line-small-title">nationality</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="nationality" class="tpl-form-input" placeholder="请输入"
                                       name="nationality"/>
                            </div>
                        </div>

                        <!--身份证号(identification)-->
                        <div class="am-form-group">
                            <label for="identification" class="am-u-sm-2 am-form-label">身份证号
                                <span class="tpl-form-line-small-title">Identification</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="identification" class="tpl-form-input" placeholder="请输入"
                                       name="identification"/>
                            </div>
                        </div>
                        <!--电话号码(tel)-->
                        <div class="am-form-group">
                            <label for="tel" class="am-u-sm-2 am-form-label">电话号码
                                <span class="tpl-form-line-small-title">tel</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="tel" class="tpl-form-input" placeholder="请输入"
                                       name="tel"/>
                            </div>
                        </div>
                        <!--现居住地(address)-->
                        <div class="am-form-group">
                            <label for="address" class="am-u-sm-2 am-form-label">现居住地
                                <span class="tpl-form-line-small-title">address</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="address" class="tpl-form-input" placeholder="请输入"
                                       name="address"/>
                            </div>
                        </div>

                        <!--技术特长(technicalExpertise)-->
                        <div class="am-form-group">
                            <label for="technicalExpertise" class="am-u-sm-2 am-form-label">技术特长
                                <span class="tpl-form-line-small-title">technicalExpertise</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="technicalExpertise" class="tpl-form-input" placeholder="请输入"
                                       name="technicalExpertise"/>
                            </div>
                        </div>

                        <!--从业时间(employmentTime)-->
                        <div class="am-form-group">
                            <label for="employmentTime" class="am-u-sm-2 am-form-label">从业时间
                                <span class="tpl-form-line-small-title">employmentTime</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="employmentTime" class="form-control validate[required]"
                                       onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="employmentTime"
                                       placeholder="请选择日期"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">

                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交
                                </button>
                                <button type="button" onclick="loadPage('maintenanceMan/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();

    function validateUserForm() {
        valdater = $('#maintenanceManForm').validate({
            errorElement: 'span',
            errorClass: 'am-icon-times',
            focusInvalid: true,
            onkeyup: false,
            ignore: "",
            rules: {
                title: {
                    required: true
                }
            },
            messages: {
                name: {
                    required: "请填写标题"
                }
            }
        });
    }

    function doSubmit() {
        if (valdater.form()) {
            commit('maintenanceManForm', 'maintenanceMan/save', 'maintenanceMan/listUI');
            return true;
        }
        return false;
    }

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>